const mysql = require('mysql')

// 创建链接
const db = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: '123456',
    database: 'test'
})
// 如果执行的select语句，则返回的是数组
db.query('select  * from human',(err,results)=>{
    console.log('error',err);
    console.log(results)
})